﻿<!DOCTYPE html>
<!--HTML5 doctype-->
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
<title>我的订单 - {site.name}</title>
<meta name="keywords" content="{site.seo_keyword}" />
<meta name="description" content="{site.seo_description}" />
<link rel="stylesheet" type="text/css" href="<%templateskin%>/css/style.css" />
<script type="text/javascript" charset="utf-8" src="<%templateskin%>/js/zepto.min.js"></script>
<script type="text/javascript" charset="utf-8" src="<%templateskin%>/js/weui.min.js"></script>
<script type="text/javascript" charset="utf-8" src="<%templateskin%>/js/common.js"></script>
</head>

<body ontouchstart>
<div class="page">
    <!--页面头部-->
    <div class="header">
        <a class="back" href="javascript:history.back();">
            <i class="iconfont icon-arrow-left"></i>
        </a>
        <h3>我的订单</h3>
        <div class="right"> 
            <a class="weui-cell_access weui-cell_link" href="<%linkurl("usercenter","index")%>">
                <i class="iconfont icon-user"></i>
            </a>
        </div>
    </div>
    <!--/页面头部-->
    
    <div class="page__bd">
        <!--订单列表-->
        <div class="detail-list">
            <ul>
                <!--取得一个DataTable-->
                <%set DataTable list=get_order_list(10, page, "user_id="+userModel.id, out totalcount)%>
                <!--取得分页页码列表-->
                <%set string pagelist=get_page_link(10, page, totalcount, "userorder", action, "__id__")%>
                <%foreach(DataRow dr in list.Rows)%>
                <li>
                    <div class="detail-hd">
                        <span class="fr"><%=get_order_status({strtoint({dr[id]})})%></span>
                        <span>{dr[order_no]}</span>
                    </div>
                    <div class="detail-bd">
                        <%set List<ByteSite.Entitys.article> ls=get_order_goods_list({strtoint({dr[id]})})%>
                        <%if(ls!=null)%>
                            <%foreach(ByteSite.Entitys.article modelt in ls)%>
                            <div class="list-box">
                                <div class="img-box">
                                    <img src="{modelt.img_url}" />
                                </div>
                                <div class="txt-box">
                                    <h2>{modelt.title}</h2>
                                    <p class="note">
                                        <span class="fr"></span>
                                        <span class="price">￥{modelt.fields[sell_price]}</span>
                                    </p>
                                </div>
                            </div>
                            <%/foreach%>
                        <%/if%>
                    </div>
                    <div class="detail-ft">
                        <p class="fr">订单总金额：￥{dr[order_amount]}元</p>
                        <p>{dr[add_time]}</p>
                        <div class="ft-btn">
                            <div class="btn-box">
                                <a href="<%linkurl("userorder_show",{dr[id]})%>">查看订单</a>
                                <%if(get_order_payment_status({strtoint({dr[id]})}))%>
                                <a href="<%linkurl("payment","?action=confirm&order_no="+{dr[order_no]})%>">去付款</a>
                                <%/if%>
                                <%if({strtoint({dr[status]})}<2)%>
                                <a href="javascript:;" onclick="clickSubmit('{config.webpath}tools/submit_ajax.ashx?action=order_cancel&order_no={dr[order_no]}');">取消订单</a>
                                <%/if%>
                            </div>
                        </div>
                    </div>
                </li>
                <%/foreach%>
                <%if(list.Rows.Count==0)%>
                <div class="nodata">暂无记录...</div>
                <%/if%>
            </ul>
        </div>
        
        <!--分页页码-->
        <div class="page-list">
            {pagelist}
        </div>
        <!--/分页页码-->
        
        <input id="turl" type="hidden" value="<%linkurl("useraddress")%>" /><!--存在跳转的URL值-->
        <!--/订单列表-->
    </div>
    
    <!--版权信息-->
    <%template src="_copyright.html"%>
    <!--/版权信息-->

    <!--底部导航-->
    <%template src="_footer.html"%>
    <!--/底部导航-->
</div>
</body>
</html>
